/************************************************************************
 * SMLib - State Model Library
 * Copyright (C) 2012-2013 Ali Khalili (khalili_DOT_ir_@SIGN_gmail_DOT_com)
 * **********************************************************************
 * This program is free software; you can redistribute it and/or modify it
 * under the terms of the GNU Lesser General Public License (LGPL) published 
 * by the Free Software Foundation; either version 2.1 of the License, or (at your
 * option) any later version. This program is distributed without any
 * warranty. See the GNU Lesser General Public License for more details. 
 * ***********************************************************************
 * File         :     
 * Description  :     
 * Change log   :     
 * To Do        :
 ************************************************************************/
using System;
using SMLib.Automata.MM;
using System.Xml;
using System.IO;

namespace SMLib.Interoperability.XML
{

	public class XmlHelper_MM
	{
		class MM_XML_Helper:IExImHelper<MealyMachine.Mealy_State,MealyMachine.Mealy_Transition>
		{
			#region IExImHelper[MealyMachine.Mealy_State,MealyMachine.Mealy_Transition] implementation
			public string StringOf (MealyMachine.Mealy_State state)
			{
				return state.Identifier.ToString();
			}

			public string StringOf (MealyMachine.Mealy_Transition tr)
			{
				return tr.ToString();
			}

			public MealyMachine.Mealy_Transition ParseEdge (string tr)
			{
				throw new NotImplementedException ();
			}

			public MealyMachine.Mealy_State ParseState (string st)
			{
				throw new NotImplementedException ();
			}
			#endregion			
		}
		
		/// <summary>
		/// Not usable. You should use the static members
		/// </summary>
		private XmlHelper_MM ()
		{
		}
		
		public static void ExportToXml(MealyMachine m,string path)
		{
			XmlHelper<MealyMachine.Mealy_State,MealyMachine.Mealy_Transition> helper;
			MM_XML_Helper mmhelper=new MM_XML_Helper();
			helper = new XmlHelper<MealyMachine.Mealy_State,MealyMachine.Mealy_Transition>(mmhelper);
			string XML=helper.WriteToXML(m);
			System.IO.File.WriteAllText(XML,path);			
		}
		
		public static MealyMachine ReadFromXml(string path)
		{


			return null;
		}
	}
}

